// 全局根路径
axios.defaults.baseURL = 'http://124.223.14.236:8060/home'

// 请求拦截器
axios.interceptors.request.use(config => {
  // 判断请求的url是否包含
  // console.log(config);
  config.headers.token = localStorage.getItem('token')

  return config;
}, error => {
  // Do something with request error
  return Promise.reject(error);
});

// 响应拦截器
axios.interceptors.response.use(response => {
  // Do something before response is sent
  return response;
}, error => {
  // Do something with response error
  return Promise.reject(error);
});